package com.wlz.util;

import org.apache.commons.codec.digest.DigestUtils;

import java.io.FileInputStream;
import java.util.UUID;

/**
 *  md5 算法
 * @author wlz
 * @date 2022-11-28  1:45 下午
 */
public class Md5Utils {

    public static void main(String[] args) throws Exception {

        // http://fota.bjev.com.cn/tbox-api/api/fota/f3?FileId=d0c6c333-07a5-426d-a0b0-df7953334a0e&VIN=LNBMC52K1PZ038575&TaskCarId=8243160c-0fde-4827-a09b-1ee89cc6eb89
        String path = "/Users/wlz/Downloads/a18c73af-da81-44af-a24d-61f76482eeca0.zip";
        String md5 = DigestUtils.md5Hex(new FileInputStream(path));
        System.out.println("md5 = " + md5);

//        String path2 = "/Users/wlz/Desktop/HDiffPatch/package/out-new.zip";
//        String md52 = DigestUtils.md5Hex(new FileInputStream(path2));
//        System.out.println("md5 = " + md52);
//
//        String path3 = "/Users/wlz/Desktop/无标题 3.xlsx";
//        String md53 = DigestUtils.md5Hex(new FileInputStream(path3));
//        System.out.println("md5 = " + md53);
    }

}
